Skip to content

fix pylock.toml export dropping wheels when the sdist sorts between wheels - #379

Merged
radoering merged 1 commit into
python-poetry:mainfrom
RaphaelFakhri:fix-pylock-sdist-between-wheels
Nov 21, 2026
Merged

radoering merged 1 commit into
python-poetry:mainfrom
RaphaelFakhri:fix-pylock-sdist-between-wheels

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

Pull Request Check List

Resolves: #378

  • Added tests for changed code.
  • Updated documentation for changed code.

Summary

The pylock.toml export split package.files into sdists and wheels with itertools.groupby. groupby only groups consecutive items, and the lock file sorts files by file name. When the sdist file name sorts between wheel file names, the second "wheel" group replaced the first one, so wheels were missing from the export.

Real example: ruamel.yaml.clib 0.2.14 has 54 ruamel.yaml.clib-* wheels, then ruamel.yaml.clib-0.2.14.tar.gz, then 2 ruamel_yaml_clib-* wheels. The export listed only the last 2 wheels.

This change filters package.files by kind instead of grouping consecutive items. The order of files within each kind is unchanged.

Testing

  • New test test_export_pypi_dependencies_sdist_sorted_between_wheels fails on main (the first wheel is missing) and passes with this change.
  • pytest tests: 179 passed. ruff check, ruff format --check and mypy src are clean.

No documentation change is needed because this fixes the output to match the documented behavior.

@radoering
radoering force-pushed the fix-pylock-sdist-between-wheels branch from 16dd63d to 5688c24 Compare November 21, 2026 12:42
@sonarqubecloud

Copy link
Copy Markdown

@radoering
radoering merged commit 6364a2c into python-poetry:main Nov 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pylock.toml export drops wheels when the sdist sorts between wheels

2 participants